import store from '@/store'

let columns

if (store.state.user.info.isAdmin) {
  columns = [
    {
      title: '申请单号',
      key: 'applyNo',
      // sorter: (a, b) => a.applyNo - b.applyNo,
      dataIndex: 'applyNo'
    },
    {
      title: '申请时间',
      key: 'createTime',
      dataIndex: 'createTime',
      scopedSlots: { customRender: 'createTime' }
    },
    {
      title: '申请类型',
      key: 'type',
      dataIndex: 'type',
      scopedSlots: { customRender: 'type' }
    },
    {
      title: '申请者ID',
      key: 'createrId',
      dataIndex: 'createrId'
    },
    {
      title: '收款者编号',
      key: 'ptsNo',
      dataIndex: 'ptsNo',
      scopedSlots: { customRender: 'ptsNo' }
    },
    {
      title: '申请金额',
      key: 'totalAmount',
      dataIndex: 'totalAmount'
    },
    {
      title: '付款时间',
      key: 'payTime',
      dataIndex: 'payTime',
      scopedSlots: { customRender: 'createTime' }
    },
    {
      title: '付款单号',
      key: 'payNo',
      dataIndex: 'payNo'
    },
    {
      title: '操作',
      dataIndex: 'operation',
      scopedSlots: { customRender: 'operation' }
    }
  ]
} else {
  columns = [
    {
      title: '申请单号',
      key: 'applyNo',
      // sorter: (a, b) => a.applyNo - b.applyNo,
      dataIndex: 'applyNo'
    },
    {
      title: '审核状态',
      key: 'status',
      dataIndex: 'status',
      scopedSlots: { customRender: 'status' }
    },
    {
      title: '申请时间',
      key: 'createTime',
      dataIndex: 'createTime',
      scopedSlots: { customRender: 'createTime' }
    },
    {
      title: '申请类型',
      key: 'type',
      dataIndex: 'type',
      scopedSlots: { customRender: 'type' }
    },
    {
      title: '收款者编号',
      key: 'ptsNo',
      dataIndex: 'ptsNo',
      scopedSlots: { customRender: 'ptsNo' }
    },
    {
      title: '申请金额',
      key: 'totalAmount',
      dataIndex: 'totalAmount'
    },
    {
      title: '申请备注',
      key: 'applyReason',
      dataIndex: 'applyReason'
    },
    {
      title: '操作',
      dataIndex: 'operation',
      scopedSlots: { customRender: 'operation' }
    }
  ]
}

export { columns }
